pp108 : Setting Access Control at the Server Level

Setting Access Control at the Server Level

This topic describes the process of setting access on objects and attributes at the server level.


You can set access control on objects and attributes to restrict their accessibility in transactions. Access control on objects is set using the onAccess event listener, whereas access control on attributes is set using the onAccess_<Attribute Name> event listener.
The following access modes are set on objects and attributes transacting at the server:

  • Read-only
  • Read-write
  • Hide

Access Control on Objects


To set access control on objects, you can invoke the listener either implicitly or explicitly. However, when you invoke the listener in both ways, precedence is given to implicit listeners.

To invoke the listener implicitly, use the ObjectAccessEvent event in the onAccess method.

To invoke the listener explicitly, register a class that implements the IObjectAccessListener interface, and use the onObjectAccess method.

Access Control on Attributes


To set access control on attributes, you can invoke the listener either implicitly or explicitly. However, when you invoke the listener in both ways, precedence is given to implicit listeners.

To invoke the listener implicitly, use the AttributeAccessEvent event in the onAccess_<Attribute Name> method.

To invoke the listener explicitly, register a class that implements the IAttributeAccessListener interface, and use the onAttributeAccess method .

Alternatively, you can set access on attributes at the object level, using the setAccess method of the ObjectAccessEvent class.
Described below are different ways in which you can set access on attributes, based on the requirement:

  • You can set access on a particular attribute by providing the name of the attribute and the access mode.
  • You can set the same access on all the attributes of an object by providing the parameters "null" and the "access mode".
  • You can also set different access controls on different attributes of the same object by combining the above two approaches.

    Setting the access mode of all attributes in a single instance reduces the number of methods to be defined. It not only minimizes the coding required but also ensures better performance by minimizing the number of methods to be invoked at runtime.

Related reference

Setting Access Control at the Client Level
A Quick Reference to Access Control

Related information

Setting Access Control